class LoginCommand

  def initialize(username, password, navigator)
    @username = username
    @password = password
    @navigator = navigator
  end

  def execute(b)
    @navigator.goto 'hd/index.ssp', b
    login b
  end

  private

  def login(b)
    b.text_field(name: 'user_id').set @username
    b.text_field(name: 'user_pwd').set @password
    b.button(value: 'Log on').click
  end

end